﻿@{
    ViewBag.Title = "材料采购合同导入";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<link href="~/Content/css/ContractRegistrationAdd.css" rel="stylesheet" />
<script type="text/javascript">
    $(function () {
        Index.init();
    });

    var Index = {
        init: function () {
            with (Index) {
                initControl();
            }

            $.initUploadFile({
                onUploadError: function (file, errorCode, errorMsg, errorString) {
                    var errMsg = "文件 {0} 无法完成上传:  {1}".format(file.name, errorString);

                    $.modalAlert(errMsg, "error");
                },
                onUploadSuccess: function (file, data, response) {
                    var result = JSON.parse(data);

                    result.success && (function () {
                        //"console" in window && console.log(result.fileContent);
                        $("#FILECONTENT").val(result.fileContent);
                    })();
                    result.success || (function () {
                        "console" in window && console.log(result.errMsg);
                    })();
                }
            });


        },
        initControl: function () {
            $("[date-control]").val(new Date().format("yyyy.MM"));

            $("[date-control]").on("click", function () {
                WdatePicker({ dateFmt: 'yyyy.MM', minDate: '2000-1', maxDate: '2050-12' });
            });
        }
    };
</script>

<div class="layout" id="layout">
    <h1>材料采购合同导入</h1>
    <ul class="form_list">
        <li class="form_item form_item_1">
            <label>
                合同日期
            </label>
            <div class="input_c">
                <input id="HTRQ" name="" placeholder="" type="text" class="form-control required" date-control />
                <input id="FILECONTENT" name="" type="hidden" class="form-control required" />
            </div>
            <div class="form_item_after">*</div>
        </li>
        <li class="form_item form_item_1">
            <label>选择EXCEL</label>
            <div class="input_c">
                <input id="HTPH" name="" type="file" class="form-control required" />
            </div>
            <div class="form_item_after">*</div>
        </li>
        <li clear></li>
    </ul>
</div>

